package com.tjs.lucky.common;

/**
 * @author tianjiashu（mac）
 * @ClassName RedisKey.java
 * @Description
 * @createTime 2023年06月25日 23:05:00
 */

/**
 * 缓存 Key
 */
public final class RedisKey {

    // 抽奖活动库存 Key
    private static final String LOTTERY_ACTIVITY_STOCK_COUNT = "lucky_activity_stock_count_";

    public static String KEY_LOTTERY_ACTIVITY_STOCK_COUNT(Long activityId) {
        return LOTTERY_ACTIVITY_STOCK_COUNT + activityId;
    }

    // 抽奖活动库存锁 Key
    private static final String LOTTERY_ACTIVITY_STOCK_COUNT_TOKEN = "lucky_activity_stock_count_token_";

    public static String KEY_LOTTERY_ACTIVITY_STOCK_COUNT_TOKEN(Long activityId, Integer stockUsedCount) {
        return LOTTERY_ACTIVITY_STOCK_COUNT_TOKEN + activityId + "_" + stockUsedCount;
    }

}
